package com.example.yichuangyun.mvvm.di.retrofit;

import android.util.Log;

import io.reactivex.subscribers.ResourceSubscriber;

public abstract class BaseNetCallback<T> extends ResourceSubscriber<BaseModel<T>> {
    @Override
    public void onNext(BaseModel<T> tBaseModel) {
        onSuccess(tBaseModel);
    }

    @Override
    public void onError(Throwable paramThrowable) {
        onError(paramThrowable.getMessage());
    }

    @Override
    public void onComplete() {
    }

    public abstract void onSuccess(BaseModel<T> baseModel);

    public void onError(String message) {
        Log.e("onError", message);
    }
}
